# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=asteroid
pkgname=lipstick-asteroidos
pkgver=2.0.0
pkgrel=1
pkgdesc="A project aimed at offering easy to modify user experiences for varying mobile device form factors"
url="https://github.com/AsteroidOS/lipstick"
# armhf blocked by nemo-qml-plugin-devicelock
arch="all !armhf"
license="LGPL-2.1-only"
depends_dev="
	bluez-qt5-dev
	elogind-dev
	libdsme-dev
	libmce-qt-dev
	libngf-qt-dev
	libresourceqt-dev
	libusb-moded-qt-dev
	libxkbcommon-dev
	mlite-dev
	nemo-keepalive-dev
	nemo-qml-plugin-devicelock-dev
	nemo-qml-plugin-systemsettings-dev
	pulseaudio-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtsensors-dev
	qt5-qtsystems-dev
	qt5-qttools-dev
	qt5-qtwayland-dev
	ssu-sysinfo-dev
	user-managerd-dev
	wayland-dev
	"
makedepends="$depends_dev
	doxygen
	graphviz
	"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-tools"
source="$pkgname-$pkgver.tar.gz::https://github.com/AsteroidOS/lipstick/archive/refs/tags/$pkgver.tar.gz
	0001-Drop-Qt-extended-surface.patch
	0002-Disables-tests-and-doc.patch
	"
options="!check" # Broken
builddir="$srcdir/lipstick-$pkgver"

provides="lipstick=$pkgver-r$pkgrel"
replaces="lipstick lipstick-glacier"

build() {
	qmake-qt5
	make
}

check() {
	make check
}

package() {
	INSTALL_ROOT="$pkgdir" make install

	mkdir -p "$pkgdir"/usr/share/dbus-1/system.d/
	mv "$pkgdir"/etc/dbus-1/system.d/* "$pkgdir"/usr/share/dbus-1/system.d/
}

tools() {
	pkgdesc="Useful command line tools for Lipstick"

	amove usr/bin
}

sha512sums="
e4e65a328bdac7c5a0bfcb8f9bf54f749ab5cb0bf1ef1d5f2829866ff0f7698fcf174c8871d58c700e198a992b3cc0ccfd74eae3d6ab748f51514e4331c51a29  lipstick-asteroidos-2.0.0.tar.gz
b08c875045ce84beea6bab5c22aafc7eb32668450d3b9ed2163718adedf1f19e16e9d143514882e06da38e720f508924f641a80a654eea0e76af873088c16233  0001-Drop-Qt-extended-surface.patch
221e2a75d660197364372ea8718ee6b0a476b6f8f413157b8524ec5cca57d45779b02fe7fc433727af2c8e47b52ddc6a784063fe7d1608d98396464935447a78  0002-Disables-tests-and-doc.patch
"
